import React from 'react'
import ReactDOM from 'react-dom/client'
import { Route, HashRouter, Routes } from 'react-router-dom';
import router from '@/router' //路由
import '@/assets/css/reset.css' // 初始化css
import styles from '@/main.module.less'
// mobx
import StoreContext from '@/contexts/storeContext'
import store from '@/store'
//公共组件
import SliderMenu from "@/layout/SlideMenu"
import NavigationBar from "@/layout/NavigationBar"
// import Breadcrumb from "@/components/Breadcrumb"

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <StoreContext.Provider value={store}>
      <HashRouter>
        <div className={styles.appContainer}>
          <NavigationBar />
          <div className={styles.appContent}>
            <SliderMenu />
            <div className={styles.container}>
              <div className={`${styles.test1} ${styles.test2}`}>
                面包屑
                {/* <Breadcrumb /> */}
              </div>
              <Routes>
                {
                  router.map((item) => {
                    return (
                      <Route
                        key={item.path}
                        path={item.path}
                        element={<item.component />}
                      />
                    )
                  })
                }
              </Routes>
            </div>
          </div>
        </div>
      </HashRouter>
    </StoreContext.Provider>
  </React.StrictMode>
)
